import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule, Routes } from '@angular/router';
import { HttpModule, JsonpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { LoginComponent } from './page/login/login.component';
import { MainModule } from './main.module';
import { AuthenticationService } from './service/auth.service';
import { NavbarService } from './component/navbar/navbar.service';

const appRoutes: Routes = [
  { path: 'login', component: LoginComponent },
  // { path: '**', component: PageNotFoundComponent }
  {
    path: '',
    redirectTo: '/login',
    pathMatch: 'full'
  },
];

@NgModule({
  imports: [
    BrowserModule,
    HttpModule,
    JsonpModule,
    MainModule,
    RouterModule.forRoot(appRoutes)
  ],
  declarations: [
    AppComponent,
    LoginComponent
  ],
  providers: [AuthenticationService, NavbarService],
  bootstrap: [AppComponent]
})
export class AppModule { }
